package com.xingxuecn.babatis02.service.impl;

import com.xingxuecn.babatis02.common.ContextContainer;
import com.xingxuecn.babatis02.common.dto.Menu;
import com.xingxuecn.babatis02.mapper.MenuMapper;
import com.xingxuecn.babatis02.service.MenuService;

import java.util.List;

/**
 * @author Kris at 2018/9/21 9:42
 */
public class MenuServiceImpl implements MenuService {

    MenuMapper menuMapper = ContextContainer.getSqlSessionFactory().openSession().getMapper(MenuMapper.class);

    public Menu findById(Integer id) {
        return menuMapper.findById(id);
    }

    public List<Menu> findByParentId(Integer id) {
        return menuMapper.findByParenId(id);
    }
}
